import 'package:tender_flutter/page/home/model/company_detail_entity.dart';

companyDetailEntityFromJson(CompanyDetailEntity data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['companyKey'] != null) {
		data.companyKey = json['companyKey'].toString();
	}
	if (json['companyName'] != null) {
		data.companyName = json['companyName'].toString();
	}
	if (json['creditCode'] != null) {
		data.creditCode = json['creditCode'].toString();
	}
	if (json['views'] != null) {
		data.views = json['views'] is String
				? int.tryParse(json['views'])
				: json['views'].toInt();
	}
	if (json['regNumber'] != null) {
		data.regNumber = json['regNumber'].toString();
	}
	if (json['companyCode'] != null) {
		data.companyCode = json['companyCode'].toString();
	}
	if (json['regType'] != null) {
		data.regType = json['regType'].toString();
	}
	if (json['companyType'] != null) {
		data.companyType = json['companyType'].toString();
	}
	if (json['issueTime'] != null) {
		data.issueTime = json['issueTime'].toString();
	}
	if (json['invalidTime'] != null) {
		data.invalidTime = json['invalidTime'].toString();
	}
	if (json['faRen'] != null) {
		data.faRen = json['faRen'].toString();
	}
	if (json['regMoney'] != null) {
		data.regMoney = json['regMoney'].toString();
	}
	if (json['regM'] != null) {
		data.regM = json['regM'] is String
				? int.tryParse(json['regM'])
				: json['regM'].toInt();
	}
	if (json['bussinessDes'] != null) {
		data.bussinessDes = json['bussinessDes'].toString();
	}
	if (json['regOrgName'] != null) {
		data.regOrgName = json['regOrgName'].toString();
	}
	if (json['cerValidityBegin'] != null) {
		data.cerValidityBegin = json['cerValidityBegin'].toString();
	}
	if (json['cerValidityEnd'] != null) {
		data.cerValidityEnd = json['cerValidityEnd'].toString();
	}
	if (json['address'] != null) {
		data.address = json['address'].toString();
	}
	if (json['businessStatus'] != null) {
		data.businessStatus = json['businessStatus'].toString();
	}
	if (json['createDate'] != null) {
		data.createDate = json['createDate'].toString();
	}
	if (json['updateDate'] != null) {
		data.updateDate = json['updateDate'].toString();
	}
	if (json['status'] != null) {
		data.status = json['status'] is String
				? int.tryParse(json['status'])
				: json['status'].toInt();
	}
	if (json['provinceName'] != null) {
		data.provinceName = json['provinceName'].toString();
	}
	if (json['cityName'] != null) {
		data.cityName = json['cityName'].toString();
	}
	if (json['areaName'] != null) {
		data.areaName = json['areaName'].toString();
	}
	if (json['phone'] != null) {
		data.phone = json['phone'].toString();
	}
	if (json['email'] != null) {
		data.email = json['email'].toString();
	}
	if (json['webSite'] != null) {
		data.webSite = json['webSite'].toString();
	}
	if (json['bussinessBegin'] != null) {
		data.bussinessBegin = json['bussinessBegin'].toString();
	}
	if (json['bussinessEnd'] != null) {
		data.bussinessEnd = json['bussinessEnd'].toString();
	}
	if (json['chkDate'] != null) {
		data.chkDate = json['chkDate'].toString();
	}
	if (json['yearChk'] != null) {
		data.yearChk = json['yearChk'].toString();
	}
	if (json['gqBeans'] != null) {
		data.gqBeans = new List<CompanyPersonalEntity>();
		(json['gqBeans'] as List).forEach((v) {
			data.gqBeans.add(new CompanyPersonalEntity().fromJson(v));
		});
	}
	if (json['tradedic'] != null) {
		data.tradedic = json['tradedic'].toString();
	}
	return data;
}

Map<String, dynamic> companyDetailEntityToJson(CompanyDetailEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['companyKey'] = entity.companyKey;
	data['companyName'] = entity.companyName;
	data['creditCode'] = entity.creditCode;
	data['views'] = entity.views;
	data['regNumber'] = entity.regNumber;
	data['companyCode'] = entity.companyCode;
	data['regType'] = entity.regType;
	data['companyType'] = entity.companyType;
	data['issueTime'] = entity.issueTime;
	data['invalidTime'] = entity.invalidTime;
	data['faRen'] = entity.faRen;
	data['regMoney'] = entity.regMoney;
	data['regM'] = entity.regM;
	data['bussinessDes'] = entity.bussinessDes;
	data['regOrgName'] = entity.regOrgName;
	data['cerValidityBegin'] = entity.cerValidityBegin;
	data['cerValidityEnd'] = entity.cerValidityEnd;
	data['address'] = entity.address;
	data['businessStatus'] = entity.businessStatus;
	data['createDate'] = entity.createDate;
	data['updateDate'] = entity.updateDate;
	data['status'] = entity.status;
	data['provinceName'] = entity.provinceName;
	data['cityName'] = entity.cityName;
	data['areaName'] = entity.areaName;
	data['phone'] = entity.phone;
	data['email'] = entity.email;
	data['webSite'] = entity.webSite;
	data['bussinessBegin'] = entity.bussinessBegin;
	data['bussinessEnd'] = entity.bussinessEnd;
	data['chkDate'] = entity.chkDate;
	data['yearChk'] = entity.yearChk;
	if (entity.gqBeans != null) {
		data['gqBeans'] =  entity.gqBeans.map((v) => v.toJson()).toList();
	}
	data['tradedic'] = entity.tradedic;
	return data;
}

companyPersonalEntityFromJson(CompanyPersonalEntity data, Map<String, dynamic> json) {
	if (json['gdName'] != null) {
		data.gdName = json['gdName'].toString();
	}
	if (json['money'] != null) {
		data.money = json['money'].toString();
	}
	if (json['property'] != null) {
		data.property = json['property'].toString();
	}
	if (json['proportion'] != null) {
		data.proportion = json['proportion'].toString();
	}
	if (json['unit'] != null) {
		data.unit = json['unit'].toString();
	}
	if (json['memberName'] != null) {
		data.memberName = json['memberName'].toString();
	}
	if (json['position'] != null) {
		data.position = json['position'].toString();
	}
	return data;
}

Map<String, dynamic> companyPersonalEntityToJson(CompanyPersonalEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['gdName'] = entity.gdName;
	data['money'] = entity.money;
	data['property'] = entity.property;
	data['proportion'] = entity.proportion;
	data['unit'] = entity.unit;
	data['memberName'] = entity.memberName;
	data['position'] = entity.position;
	return data;
}